package day_06;

/**
 * @ClassName rectangle
 * @Description TODO
 * @Author hp
 * @Date 2021/6/8 11:18
 * @Version 1.0
 **/
public class rectangle {
    private double x,y;
    private double area;
    private double perimeter;

    public  double area(double x,double y){
        area = x*y;
        return area;
    }
    public  double  perimeter(double x,double y){
        perimeter = (x+y)*2;
        return  perimeter;
    }

    public double getArea() {
        return area;
    }

    public void setArea(double area) {
        this.area = area;
    }

    public double getPerimeter() {
        return perimeter;
    }

    public void setPerimeter(double perimeter) {
        this.perimeter = perimeter;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    @Override
    public String toString() {
        return "rectangle{" +
                "x=" + x +
                ", y=" + y +
                ", area=" + area +
                ", perimeter=" + perimeter +
                '}';
    }
}
